package com.yunc.modules.cms.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yunc.common.utils.R;
import com.yunc.modules.cms.entity.CmsCategory;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

/**
 * 文章分类service接口
 *
 * @author congcong tao
 * @date 2018/1/24 10:34
 */
public interface ICmsCategoryService extends IService<CmsCategory> {

    @Cacheable(value = "cmsCategoryAll", key = "#root.targetClass")
    List<CmsCategory> queryCategoryList(CmsCategory cmsCategory);

    String selectMaxCode(Long parentId);

    @CacheEvict(value = "cmsCategoryAll", key = "#root.targetClass")
    R saveCategory(CmsCategory category);

    @CacheEvict(value = "cmsCategoryAll", key = "#root.targetClass")
    R updateCategory(CmsCategory category);
}
